import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:leader_doctor_flutter/common/utils/meeting_utils.dart';
import 'package:leader_doctor_flutter/common/widget/comm_widget.dart';
import 'dart:developer' as dev;

import 'package:leader_doctor_flutter/plugins/plugins_messages.g.dart';
import 'package:leader_doctor_flutter/ui/task/meeting/model/result.dart';
import 'package:netease_meeting_ui/meeting_ui.dart';

/// @Author lixiaobin
/// @Date 2023/11/29
/// @Description
class MeetingPage extends StatefulWidget {
  const MeetingPage({super.key});

  @override
  State<MeetingPage> createState() => _MeetingPageState();
}

class _MeetingPageState extends State<MeetingPage> {
  @override
  void initState() {
    super.initState();
    // var arguments =
    //     ModalRoute.of(context)?.settings.arguments as Map<String, String>;
    // var mtId = arguments['mtId'] ?? '';
    // MeetingUtils.instance.joinMeeting(context, '');
  }

  @override
  Widget build(BuildContext context) {
    // var arguments =
    //     ModalRoute.of(context)?.settings.arguments as Map<String, String>;
    // var mtId = arguments['mtId'] ?? '';
    return Scaffold(
      appBar: CommWidget.getCommAppbar(context),
      body: Container(
        height: double.infinity,
        width: double.infinity,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
                child: const Text('登录云信', style: TextStyle(fontSize: 20)),
                onPressed: () async {
                  // await MeetingUtils.instance.getMeetingInfo();
                }),
            ElevatedButton(
                child: const Text('登出云信', style: TextStyle(fontSize: 20)),
                onPressed: () async {
                  await MeetingUtils.instance.logout();
                }),
            ElevatedButton(
                child:
                    const Text('入会116051897', style: TextStyle(fontSize: 20)),
                onPressed: () async {
                  // await _onJoinMeeting('116051897', '苻草兰');
                }),
            SizedBox(height: 50.w),
            // Text('登录状态：${_loginStatus == 0 ? '登录成功' : '登录失败'}',
            //     style: const TextStyle(fontSize: 20, color: Color(0xFFFF0000)))
          ],
        ),
      ),
    );
  }
}
